﻿<!DOCTYPE html>
<!--教师管理列表-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>


</head>

<body>
    <div id="app" v-cloak class="popupW50">
        <el-row>
            <el-col :span="24">
                <el-form ref="form" :inline="true" label-position="right" label-width="100px"
                         :model="formInline" class="demo-form-inline" style="margin-bottom: 15px;">
                    <el-col class="head-tool">

                        <div class="new_title fl"><strong><img src="/static/images/icon1.png" />待选择列表</strong></div>
                        <span>
                            <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3"
                                 @click="onSubmit">
                            </btn>
                            <btn :text="'选择'" imgsrc="/static/images/search.png" linetype="3"
                                 @click="XZSave">
                            </btn>
                        </span>
                    </el-col>
                    <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input v-model="formInline.model.name"
                                          :placeholder="'姓名'" size="mini">
                                    <template slot="prepend">
                                        {{'姓名'+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-form>
            </el-col>

            <el-col :span="24">
                <el-table ref="table" stripe :data="ListItem.tableData" :height="ListItem.tableHeight" border
                          @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%">
                    <el-table-column type="selection" align="center" width="55">
                    </el-table-column>
                    <el-table-column type="index" :label="col.SequenceNumber" :index="indexMethod" width="50">
                    </el-table-column>
                    <!-- <el-table-column type="index" :label="QuestionManagement.SerialNumber" :index="indexMethod" width="50"
                    show-overflow-tooltip="true"></el-table-column> -->
                    <!--<el-table-column prop="QuestionManagementType" :label="'部门职务'"
                                     width="100">
                    </el-table-column>-->
                    <el-table-column prop="name"
                                     :label="'姓名'" show-overflow-tooltip="true"
                                     min-width="400">
                    </el-table-column>



                </el-table>
                <el-row type="flex" justify="end">
                    <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                                   :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes"
                                   :page-size="ListItem.pagesize" :layout="ListItem.layout" :total="ListItem.total">
                    </el-pagination>

                </el-row>
            </el-col>
        </el-row>
        <el-dialog title="教师资格管理" fullscreen="true" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%" height="80%" top="10vh" fullscreen="true">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">

        app = new Vue({
            el: '#app',
            data: function () {
                return {
                    show: false,
                    TreeData: [],
                    mydata: QuestionManagementTree,
                    defaultProps: {
                        children: 'children',
                        label: 'label'
                    },
                    RiskLevel: [],
                    ListItem: ListItem,
                    formInline: {
                        model: {
                            QuestionManagementContent: '',//"试题内容"
                            QuestionManagementType: '', //试题类型
                            DegreeOfDifficulty: '',//难易程度
                            Answer: '',//答案
                            Courseware: '',
                            editorTime: '',
                            CoursewareID: '',//课件类型ID
                            OptionsList: [],//选项
                            TreeNode: ''
                        },
                        offset: 0,
                        limit: 10
                    }
                }
            }, created: function () {
                var currApp = this;
                window.onresize = function () {
                    currApp.ListItem.tableHeight = window.innerHeight -
                        currApp.$refs.table.$el.offsetTop - 60;
                    if (currApp.ListItem.tableHeight < 112) {
                        currApp.ListItem.tableHeight = 112;
                    }
                }
            },
            mounted: function () {
                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
                this.TreeData = fn(this.mydata, "0");
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                btnExcelTemplate: function () {
                    this.$message({
                        message: '模版导出成功！',
                        type: 'success'
                    });
                },
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },

                handleNodeClick: function (data) {
                    if (!data.children) {
                        this.formInline.model.TreeNode = data.id
                        onSubmit(this);
                    } else {
                        if (data.icon == "tree-open") {
                            data.icon = "tree-close"
                        } else (
                            data.icon = "tree-open"
                        )
                    }
                },
                closeDialog: function () { closeDialog(this); },
                //删除方法
                onDelete: function () { onDelete(this, '/api/PX_Teacher/DeleteMuti'); },

                XZSave: function () {
                    if (this.ListItem.tableMultipleSelection.length == 0) {
                        showMessage(msg.AtLeastOne, 'error')
                        return;
                    }
                    var mythis = this;
                    var delIds = [];
                    for (var i = 0; i < mythis.ListItem.tableMultipleSelection.length; i++) {
                        var item = mythis.ListItem.tableMultipleSelection[i];
                        delIds.push(item.id);
                    }
                    myAjax("post", mythis, '/api/PX_Teacher/XZSave', delIds, function (response) {
                        
                        showMessage(msg.OperatingOk, "success");
                        parent.app.ListItem.dialogVisible = false;
                    });
                },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
         
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/PX_Teacher/GetXZList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); }
            }
        });

    </script>
</body>

</html>